﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on: 
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using VNet.VisiSuite.Dal;
using VNet.VisiSuite.Dal.HelperClasses;
using VNet.VisiSuite.Dal.FactoryClasses;
using VNet.VisiSuite.Dal.RelationClasses;

using SD.LLBLGen.Pro.ORMSupportClasses;

namespace VNet.VisiSuite.Dal.EntityClasses
{
	// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
	// __LLBLGENPRO_USER_CODE_REGION_END
	/// <summary>Entity class which represents the entity 'UserLogin'.<br/><br/></summary>
	[Serializable]
	public partial class UserLoginEntity : CommonEntityBase
		// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
		// __LLBLGENPRO_USER_CODE_REGION_END	
	{
		#region Class Member Declarations
		private EntityCollection<AlarmSettingEntity> _alarmSettings;
		private EntityCollection<AlarmSettingEntity> _alarmSettings1;
		private EntityCollection<AreaEntity> _areas;
		private EntityCollection<AreaEntity> _areas1;
		private EntityCollection<AreaShiftEntity> _areaShifts;
		private EntityCollection<AreaShiftEntity> _areaShifts1;
		private EntityCollection<CellEntity> _cells;
		private EntityCollection<CellEntity> _cells1;
		private EntityCollection<CellAlarmSettingEntity> _cellAlarmSettings;
		private EntityCollection<CellAlarmSettingEntity> _cellAlarmSettings1;
		private EntityCollection<DowntimeButtonEntity> _downtimeButtons;
		private EntityCollection<DowntimeButtonEntity> _downtimeButtons_;
		private EntityCollection<LaunchApplicationEntity> _launchApplications;
		private EntityCollection<LaunchApplicationEntity> _launchApplications1;
		private EntityCollection<PlantEntity> _plants;
		private EntityCollection<PlantEntity> _plants1;
		private EntityCollection<ProductEntity> _products;
		private EntityCollection<ProductEntity> _products1;
		private EntityCollection<ProductionPlanEntity> _productionPlans;
		private EntityCollection<ProductionPlanEntity> _productionPlans1;
		private EntityCollection<ProductionPlanScheduledDowntimeEntity> _productionPlanScheduledDowntimes;
		private EntityCollection<ProductionPlanScheduledDowntimeEntity> _productionPlanScheduledDowntimes1;
		private EntityCollection<ReasonCodeEntity> _reasonCodes;
		private EntityCollection<ReasonCodeEntity> _reasonCodes1;
		private EntityCollection<RollupDefinitionEntity> _rollupDefinitions;
		private EntityCollection<RollupDefinitionEntity> _rollupDefinitions1;
		private EntityCollection<ScheduleEntity> _schedules;
		private EntityCollection<ScheduleEntity> _schedules1;
		private EntityCollection<UserLoginEntity> _userLogins;
		private EntityCollection<UserLoginEntity> _userLogins1;
		private EntityCollection<UserLoginHistoryEntity> _userLoginHistories;
		private UserLoginEntity _userLogin;
		private UserLoginEntity _userLogin1;

		// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
		// __LLBLGENPRO_USER_CODE_REGION_END
		#endregion

		#region Statics
		private static Dictionary<string, string>	_customProperties;
		private static Dictionary<string, Dictionary<string, string>>	_fieldsCustomProperties;

		/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
		public static partial class MemberNames
		{
			/// <summary>Member name UserLogin</summary>
			public static readonly string UserLogin = "UserLogin";
			/// <summary>Member name UserLogin1</summary>
			public static readonly string UserLogin1 = "UserLogin1";
			/// <summary>Member name AlarmSettings</summary>
			public static readonly string AlarmSettings = "AlarmSettings";
			/// <summary>Member name AlarmSettings1</summary>
			public static readonly string AlarmSettings1 = "AlarmSettings1";
			/// <summary>Member name Areas</summary>
			public static readonly string Areas = "Areas";
			/// <summary>Member name Areas1</summary>
			public static readonly string Areas1 = "Areas1";
			/// <summary>Member name AreaShifts</summary>
			public static readonly string AreaShifts = "AreaShifts";
			/// <summary>Member name AreaShifts1</summary>
			public static readonly string AreaShifts1 = "AreaShifts1";
			/// <summary>Member name Cells</summary>
			public static readonly string Cells = "Cells";
			/// <summary>Member name Cells1</summary>
			public static readonly string Cells1 = "Cells1";
			/// <summary>Member name CellAlarmSettings</summary>
			public static readonly string CellAlarmSettings = "CellAlarmSettings";
			/// <summary>Member name CellAlarmSettings1</summary>
			public static readonly string CellAlarmSettings1 = "CellAlarmSettings1";
			/// <summary>Member name DowntimeButtons</summary>
			public static readonly string DowntimeButtons = "DowntimeButtons";
			/// <summary>Member name DowntimeButtons_</summary>
			public static readonly string DowntimeButtons_ = "DowntimeButtons_";
			/// <summary>Member name LaunchApplications</summary>
			public static readonly string LaunchApplications = "LaunchApplications";
			/// <summary>Member name LaunchApplications1</summary>
			public static readonly string LaunchApplications1 = "LaunchApplications1";
			/// <summary>Member name Plants</summary>
			public static readonly string Plants = "Plants";
			/// <summary>Member name Plants1</summary>
			public static readonly string Plants1 = "Plants1";
			/// <summary>Member name Products</summary>
			public static readonly string Products = "Products";
			/// <summary>Member name Products1</summary>
			public static readonly string Products1 = "Products1";
			/// <summary>Member name ProductionPlans</summary>
			public static readonly string ProductionPlans = "ProductionPlans";
			/// <summary>Member name ProductionPlans1</summary>
			public static readonly string ProductionPlans1 = "ProductionPlans1";
			/// <summary>Member name ProductionPlanScheduledDowntimes</summary>
			public static readonly string ProductionPlanScheduledDowntimes = "ProductionPlanScheduledDowntimes";
			/// <summary>Member name ProductionPlanScheduledDowntimes1</summary>
			public static readonly string ProductionPlanScheduledDowntimes1 = "ProductionPlanScheduledDowntimes1";
			/// <summary>Member name ReasonCodes</summary>
			public static readonly string ReasonCodes = "ReasonCodes";
			/// <summary>Member name ReasonCodes1</summary>
			public static readonly string ReasonCodes1 = "ReasonCodes1";
			/// <summary>Member name RollupDefinitions</summary>
			public static readonly string RollupDefinitions = "RollupDefinitions";
			/// <summary>Member name RollupDefinitions1</summary>
			public static readonly string RollupDefinitions1 = "RollupDefinitions1";
			/// <summary>Member name Schedules</summary>
			public static readonly string Schedules = "Schedules";
			/// <summary>Member name Schedules1</summary>
			public static readonly string Schedules1 = "Schedules1";
			/// <summary>Member name UserLogins</summary>
			public static readonly string UserLogins = "UserLogins";
			/// <summary>Member name UserLogins1</summary>
			public static readonly string UserLogins1 = "UserLogins1";
			/// <summary>Member name UserLoginHistories</summary>
			public static readonly string UserLoginHistories = "UserLoginHistories";
		}
		#endregion
		
		/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
		static UserLoginEntity()
		{
			SetupCustomPropertyHashtables();
		}
		
		/// <summary> CTor</summary>
		public UserLoginEntity():base("UserLoginEntity")
		{
			InitClassEmpty(null, null);
		}

		/// <summary> CTor</summary>
		/// <remarks>For framework usage.</remarks>
		/// <param name="fields">Fields object to set as the fields for this entity.</param>
		public UserLoginEntity(IEntityFields2 fields):base("UserLoginEntity")
		{
			InitClassEmpty(null, fields);
		}

		/// <summary> CTor</summary>
		/// <param name="validator">The custom validator object for this UserLoginEntity</param>
		public UserLoginEntity(IValidator validator):base("UserLoginEntity")
		{
			InitClassEmpty(validator, null);
		}
				
		/// <summary> CTor</summary>
		/// <param name="userLoginId">PK value for UserLogin which data should be fetched into this UserLogin object</param>
		/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
		public UserLoginEntity(System.Int32 userLoginId):base("UserLoginEntity")
		{
			InitClassEmpty(null, null);
			this.UserLoginId = userLoginId;
		}

		/// <summary> CTor</summary>
		/// <param name="userLoginId">PK value for UserLogin which data should be fetched into this UserLogin object</param>
		/// <param name="validator">The custom validator object for this UserLoginEntity</param>
		/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
		public UserLoginEntity(System.Int32 userLoginId, IValidator validator):base("UserLoginEntity")
		{
			InitClassEmpty(validator, null);
			this.UserLoginId = userLoginId;
		}

		/// <summary> Protected CTor for deserialization</summary>
		/// <param name="info"></param>
		/// <param name="context"></param>
		[EditorBrowsable(EditorBrowsableState.Never)]
		protected UserLoginEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			if(SerializationHelper.Optimization != SerializationOptimization.Fast) 
			{
				_alarmSettings = (EntityCollection<AlarmSettingEntity>)info.GetValue("_alarmSettings", typeof(EntityCollection<AlarmSettingEntity>));
				_alarmSettings1 = (EntityCollection<AlarmSettingEntity>)info.GetValue("_alarmSettings1", typeof(EntityCollection<AlarmSettingEntity>));
				_areas = (EntityCollection<AreaEntity>)info.GetValue("_areas", typeof(EntityCollection<AreaEntity>));
				_areas1 = (EntityCollection<AreaEntity>)info.GetValue("_areas1", typeof(EntityCollection<AreaEntity>));
				_areaShifts = (EntityCollection<AreaShiftEntity>)info.GetValue("_areaShifts", typeof(EntityCollection<AreaShiftEntity>));
				_areaShifts1 = (EntityCollection<AreaShiftEntity>)info.GetValue("_areaShifts1", typeof(EntityCollection<AreaShiftEntity>));
				_cells = (EntityCollection<CellEntity>)info.GetValue("_cells", typeof(EntityCollection<CellEntity>));
				_cells1 = (EntityCollection<CellEntity>)info.GetValue("_cells1", typeof(EntityCollection<CellEntity>));
				_cellAlarmSettings = (EntityCollection<CellAlarmSettingEntity>)info.GetValue("_cellAlarmSettings", typeof(EntityCollection<CellAlarmSettingEntity>));
				_cellAlarmSettings1 = (EntityCollection<CellAlarmSettingEntity>)info.GetValue("_cellAlarmSettings1", typeof(EntityCollection<CellAlarmSettingEntity>));
				_downtimeButtons = (EntityCollection<DowntimeButtonEntity>)info.GetValue("_downtimeButtons", typeof(EntityCollection<DowntimeButtonEntity>));
				_downtimeButtons_ = (EntityCollection<DowntimeButtonEntity>)info.GetValue("_downtimeButtons_", typeof(EntityCollection<DowntimeButtonEntity>));
				_launchApplications = (EntityCollection<LaunchApplicationEntity>)info.GetValue("_launchApplications", typeof(EntityCollection<LaunchApplicationEntity>));
				_launchApplications1 = (EntityCollection<LaunchApplicationEntity>)info.GetValue("_launchApplications1", typeof(EntityCollection<LaunchApplicationEntity>));
				_plants = (EntityCollection<PlantEntity>)info.GetValue("_plants", typeof(EntityCollection<PlantEntity>));
				_plants1 = (EntityCollection<PlantEntity>)info.GetValue("_plants1", typeof(EntityCollection<PlantEntity>));
				_products = (EntityCollection<ProductEntity>)info.GetValue("_products", typeof(EntityCollection<ProductEntity>));
				_products1 = (EntityCollection<ProductEntity>)info.GetValue("_products1", typeof(EntityCollection<ProductEntity>));
				_productionPlans = (EntityCollection<ProductionPlanEntity>)info.GetValue("_productionPlans", typeof(EntityCollection<ProductionPlanEntity>));
				_productionPlans1 = (EntityCollection<ProductionPlanEntity>)info.GetValue("_productionPlans1", typeof(EntityCollection<ProductionPlanEntity>));
				_productionPlanScheduledDowntimes = (EntityCollection<ProductionPlanScheduledDowntimeEntity>)info.GetValue("_productionPlanScheduledDowntimes", typeof(EntityCollection<ProductionPlanScheduledDowntimeEntity>));
				_productionPlanScheduledDowntimes1 = (EntityCollection<ProductionPlanScheduledDowntimeEntity>)info.GetValue("_productionPlanScheduledDowntimes1", typeof(EntityCollection<ProductionPlanScheduledDowntimeEntity>));
				_reasonCodes = (EntityCollection<ReasonCodeEntity>)info.GetValue("_reasonCodes", typeof(EntityCollection<ReasonCodeEntity>));
				_reasonCodes1 = (EntityCollection<ReasonCodeEntity>)info.GetValue("_reasonCodes1", typeof(EntityCollection<ReasonCodeEntity>));
				_rollupDefinitions = (EntityCollection<RollupDefinitionEntity>)info.GetValue("_rollupDefinitions", typeof(EntityCollection<RollupDefinitionEntity>));
				_rollupDefinitions1 = (EntityCollection<RollupDefinitionEntity>)info.GetValue("_rollupDefinitions1", typeof(EntityCollection<RollupDefinitionEntity>));
				_schedules = (EntityCollection<ScheduleEntity>)info.GetValue("_schedules", typeof(EntityCollection<ScheduleEntity>));
				_schedules1 = (EntityCollection<ScheduleEntity>)info.GetValue("_schedules1", typeof(EntityCollection<ScheduleEntity>));
				_userLogins = (EntityCollection<UserLoginEntity>)info.GetValue("_userLogins", typeof(EntityCollection<UserLoginEntity>));
				_userLogins1 = (EntityCollection<UserLoginEntity>)info.GetValue("_userLogins1", typeof(EntityCollection<UserLoginEntity>));
				_userLoginHistories = (EntityCollection<UserLoginHistoryEntity>)info.GetValue("_userLoginHistories", typeof(EntityCollection<UserLoginHistoryEntity>));
				_userLogin = (UserLoginEntity)info.GetValue("_userLogin", typeof(UserLoginEntity));
				if(_userLogin!=null)
				{
					_userLogin.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_userLogin1 = (UserLoginEntity)info.GetValue("_userLogin1", typeof(UserLoginEntity));
				if(_userLogin1!=null)
				{
					_userLogin1.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
			}
			// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
			// __LLBLGENPRO_USER_CODE_REGION_END
		}

		
		/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
		/// <param name="fieldIndex">The fieldindex.</param>
		protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
		{
			switch((UserLoginFieldIndex)fieldIndex)
			{
				case UserLoginFieldIndex.CreatedBy:
					DesetupSyncUserLogin(true, false);
					break;
				case UserLoginFieldIndex.LastUpdatedBy:
					DesetupSyncUserLogin1(true, false);
					break;
				default:
					base.PerformDesyncSetupFKFieldChange(fieldIndex);
					break;
			}
		}

		/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
		/// <param name="propertyName">Name of the property.</param>
		/// <param name="entity">Entity to set as an related entity</param>
		/// <remarks>Used by prefetch path logic.</remarks>
		protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
		{
			switch(propertyName)
			{
				case "UserLogin":
					this.UserLogin = (UserLoginEntity)entity;
					break;
				case "UserLogin1":
					this.UserLogin1 = (UserLoginEntity)entity;
					break;
				case "AlarmSettings":
					this.AlarmSettings.Add((AlarmSettingEntity)entity);
					break;
				case "AlarmSettings1":
					this.AlarmSettings1.Add((AlarmSettingEntity)entity);
					break;
				case "Areas":
					this.Areas.Add((AreaEntity)entity);
					break;
				case "Areas1":
					this.Areas1.Add((AreaEntity)entity);
					break;
				case "AreaShifts":
					this.AreaShifts.Add((AreaShiftEntity)entity);
					break;
				case "AreaShifts1":
					this.AreaShifts1.Add((AreaShiftEntity)entity);
					break;
				case "Cells":
					this.Cells.Add((CellEntity)entity);
					break;
				case "Cells1":
					this.Cells1.Add((CellEntity)entity);
					break;
				case "CellAlarmSettings":
					this.CellAlarmSettings.Add((CellAlarmSettingEntity)entity);
					break;
				case "CellAlarmSettings1":
					this.CellAlarmSettings1.Add((CellAlarmSettingEntity)entity);
					break;
				case "DowntimeButtons":
					this.DowntimeButtons.Add((DowntimeButtonEntity)entity);
					break;
				case "DowntimeButtons_":
					this.DowntimeButtons_.Add((DowntimeButtonEntity)entity);
					break;
				case "LaunchApplications":
					this.LaunchApplications.Add((LaunchApplicationEntity)entity);
					break;
				case "LaunchApplications1":
					this.LaunchApplications1.Add((LaunchApplicationEntity)entity);
					break;
				case "Plants":
					this.Plants.Add((PlantEntity)entity);
					break;
				case "Plants1":
					this.Plants1.Add((PlantEntity)entity);
					break;
				case "Products":
					this.Products.Add((ProductEntity)entity);
					break;
				case "Products1":
					this.Products1.Add((ProductEntity)entity);
					break;
				case "ProductionPlans":
					this.ProductionPlans.Add((ProductionPlanEntity)entity);
					break;
				case "ProductionPlans1":
					this.ProductionPlans1.Add((ProductionPlanEntity)entity);
					break;
				case "ProductionPlanScheduledDowntimes":
					this.ProductionPlanScheduledDowntimes.Add((ProductionPlanScheduledDowntimeEntity)entity);
					break;
				case "ProductionPlanScheduledDowntimes1":
					this.ProductionPlanScheduledDowntimes1.Add((ProductionPlanScheduledDowntimeEntity)entity);
					break;
				case "ReasonCodes":
					this.ReasonCodes.Add((ReasonCodeEntity)entity);
					break;
				case "ReasonCodes1":
					this.ReasonCodes1.Add((ReasonCodeEntity)entity);
					break;
				case "RollupDefinitions":
					this.RollupDefinitions.Add((RollupDefinitionEntity)entity);
					break;
				case "RollupDefinitions1":
					this.RollupDefinitions1.Add((RollupDefinitionEntity)entity);
					break;
				case "Schedules":
					this.Schedules.Add((ScheduleEntity)entity);
					break;
				case "Schedules1":
					this.Schedules1.Add((ScheduleEntity)entity);
					break;
				case "UserLogins":
					this.UserLogins.Add((UserLoginEntity)entity);
					break;
				case "UserLogins1":
					this.UserLogins1.Add((UserLoginEntity)entity);
					break;
				case "UserLoginHistories":
					this.UserLoginHistories.Add((UserLoginHistoryEntity)entity);
					break;
				default:
					this.OnSetRelatedEntityProperty(propertyName, entity);
					break;
			}
		}
		
		/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
		/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
		/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
		protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
		{
			return GetRelationsForField(fieldName);
		}

		/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
		/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
		/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
		internal static RelationCollection GetRelationsForField(string fieldName)
		{
			RelationCollection toReturn = new RelationCollection();
			switch(fieldName)
			{
				case "UserLogin":
					toReturn.Add(Relations.UserLoginEntityUsingUserLoginIdCreatedBy);
					break;
				case "UserLogin1":
					toReturn.Add(Relations.UserLoginEntityUsingUserLoginIdLastUpdatedBy);
					break;
				case "AlarmSettings":
					toReturn.Add(Relations.AlarmSettingEntityUsingCreatedBy);
					break;
				case "AlarmSettings1":
					toReturn.Add(Relations.AlarmSettingEntityUsingLastUpdatedBy);
					break;
				case "Areas":
					toReturn.Add(Relations.AreaEntityUsingCreatedBy);
					break;
				case "Areas1":
					toReturn.Add(Relations.AreaEntityUsingLastUpdatedBy);
					break;
				case "AreaShifts":
					toReturn.Add(Relations.AreaShiftEntityUsingCreatedBy);
					break;
				case "AreaShifts1":
					toReturn.Add(Relations.AreaShiftEntityUsingLastUpdatedBy);
					break;
				case "Cells":
					toReturn.Add(Relations.CellEntityUsingCreatedBy);
					break;
				case "Cells1":
					toReturn.Add(Relations.CellEntityUsingLastUpdatedBy);
					break;
				case "CellAlarmSettings":
					toReturn.Add(Relations.CellAlarmSettingEntityUsingCreatedBy);
					break;
				case "CellAlarmSettings1":
					toReturn.Add(Relations.CellAlarmSettingEntityUsingLastUpdatedBy);
					break;
				case "DowntimeButtons":
					toReturn.Add(Relations.DowntimeButtonEntityUsingCreatedBy);
					break;
				case "DowntimeButtons_":
					toReturn.Add(Relations.DowntimeButtonEntityUsingLastUpdatedBy);
					break;
				case "LaunchApplications":
					toReturn.Add(Relations.LaunchApplicationEntityUsingCreatedBy);
					break;
				case "LaunchApplications1":
					toReturn.Add(Relations.LaunchApplicationEntityUsingLastUpdatedBy);
					break;
				case "Plants":
					toReturn.Add(Relations.PlantEntityUsingCreatedBy);
					break;
				case "Plants1":
					toReturn.Add(Relations.PlantEntityUsingLastUpdatedBy);
					break;
				case "Products":
					toReturn.Add(Relations.ProductEntityUsingCreatedBy);
					break;
				case "Products1":
					toReturn.Add(Relations.ProductEntityUsingLastUpdatedBy);
					break;
				case "ProductionPlans":
					toReturn.Add(Relations.ProductionPlanEntityUsingCreatedBy);
					break;
				case "ProductionPlans1":
					toReturn.Add(Relations.ProductionPlanEntityUsingLastUpdatedBy);
					break;
				case "ProductionPlanScheduledDowntimes":
					toReturn.Add(Relations.ProductionPlanScheduledDowntimeEntityUsingCreatedBy);
					break;
				case "ProductionPlanScheduledDowntimes1":
					toReturn.Add(Relations.ProductionPlanScheduledDowntimeEntityUsingLastUpdatedBy);
					break;
				case "ReasonCodes":
					toReturn.Add(Relations.ReasonCodeEntityUsingCreatedBy);
					break;
				case "ReasonCodes1":
					toReturn.Add(Relations.ReasonCodeEntityUsingLastUpdatedBy);
					break;
				case "RollupDefinitions":
					toReturn.Add(Relations.RollupDefinitionEntityUsingCreatedBy);
					break;
				case "RollupDefinitions1":
					toReturn.Add(Relations.RollupDefinitionEntityUsingLastUpdatedBy);
					break;
				case "Schedules":
					toReturn.Add(Relations.ScheduleEntityUsingCreatedBy);
					break;
				case "Schedules1":
					toReturn.Add(Relations.ScheduleEntityUsingLastUpdatedBy);
					break;
				case "UserLogins":
					toReturn.Add(Relations.UserLoginEntityUsingCreatedBy);
					break;
				case "UserLogins1":
					toReturn.Add(Relations.UserLoginEntityUsingLastUpdatedBy);
					break;
				case "UserLoginHistories":
					toReturn.Add(Relations.UserLoginHistoryEntityUsingUserLoginId);
					break;
				default:
					break;				
			}
			return toReturn;
		}
#if !CF
		/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
		/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
		/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
		protected override bool CheckOneWayRelations(string propertyName)
		{
			int numberOfOneWayRelations = 0;
			switch(propertyName)
			{
				case null:
					return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
				default:
					return base.CheckOneWayRelations(propertyName);
			}
		}
#endif
		/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
		protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
		{
			switch(fieldName)
			{
				case "UserLogin":
					SetupSyncUserLogin(relatedEntity);
					break;
				case "UserLogin1":
					SetupSyncUserLogin1(relatedEntity);
					break;
				case "AlarmSettings":
					this.AlarmSettings.Add((AlarmSettingEntity)relatedEntity);
					break;
				case "AlarmSettings1":
					this.AlarmSettings1.Add((AlarmSettingEntity)relatedEntity);
					break;
				case "Areas":
					this.Areas.Add((AreaEntity)relatedEntity);
					break;
				case "Areas1":
					this.Areas1.Add((AreaEntity)relatedEntity);
					break;
				case "AreaShifts":
					this.AreaShifts.Add((AreaShiftEntity)relatedEntity);
					break;
				case "AreaShifts1":
					this.AreaShifts1.Add((AreaShiftEntity)relatedEntity);
					break;
				case "Cells":
					this.Cells.Add((CellEntity)relatedEntity);
					break;
				case "Cells1":
					this.Cells1.Add((CellEntity)relatedEntity);
					break;
				case "CellAlarmSettings":
					this.CellAlarmSettings.Add((CellAlarmSettingEntity)relatedEntity);
					break;
				case "CellAlarmSettings1":
					this.CellAlarmSettings1.Add((CellAlarmSettingEntity)relatedEntity);
					break;
				case "DowntimeButtons":
					this.DowntimeButtons.Add((DowntimeButtonEntity)relatedEntity);
					break;
				case "DowntimeButtons_":
					this.DowntimeButtons_.Add((DowntimeButtonEntity)relatedEntity);
					break;
				case "LaunchApplications":
					this.LaunchApplications.Add((LaunchApplicationEntity)relatedEntity);
					break;
				case "LaunchApplications1":
					this.LaunchApplications1.Add((LaunchApplicationEntity)relatedEntity);
					break;
				case "Plants":
					this.Plants.Add((PlantEntity)relatedEntity);
					break;
				case "Plants1":
					this.Plants1.Add((PlantEntity)relatedEntity);
					break;
				case "Products":
					this.Products.Add((ProductEntity)relatedEntity);
					break;
				case "Products1":
					this.Products1.Add((ProductEntity)relatedEntity);
					break;
				case "ProductionPlans":
					this.ProductionPlans.Add((ProductionPlanEntity)relatedEntity);
					break;
				case "ProductionPlans1":
					this.ProductionPlans1.Add((ProductionPlanEntity)relatedEntity);
					break;
				case "ProductionPlanScheduledDowntimes":
					this.ProductionPlanScheduledDowntimes.Add((ProductionPlanScheduledDowntimeEntity)relatedEntity);
					break;
				case "ProductionPlanScheduledDowntimes1":
					this.ProductionPlanScheduledDowntimes1.Add((ProductionPlanScheduledDowntimeEntity)relatedEntity);
					break;
				case "ReasonCodes":
					this.ReasonCodes.Add((ReasonCodeEntity)relatedEntity);
					break;
				case "ReasonCodes1":
					this.ReasonCodes1.Add((ReasonCodeEntity)relatedEntity);
					break;
				case "RollupDefinitions":
					this.RollupDefinitions.Add((RollupDefinitionEntity)relatedEntity);
					break;
				case "RollupDefinitions1":
					this.RollupDefinitions1.Add((RollupDefinitionEntity)relatedEntity);
					break;
				case "Schedules":
					this.Schedules.Add((ScheduleEntity)relatedEntity);
					break;
				case "Schedules1":
					this.Schedules1.Add((ScheduleEntity)relatedEntity);
					break;
				case "UserLogins":
					this.UserLogins.Add((UserLoginEntity)relatedEntity);
					break;
				case "UserLogins1":
					this.UserLogins1.Add((UserLoginEntity)relatedEntity);
					break;
				case "UserLoginHistories":
					this.UserLoginHistories.Add((UserLoginHistoryEntity)relatedEntity);
					break;
				default:
					break;
			}
		}

		/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
		/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
		/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
		/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
		protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
		{
			switch(fieldName)
			{
				case "UserLogin":
					DesetupSyncUserLogin(false, true);
					break;
				case "UserLogin1":
					DesetupSyncUserLogin1(false, true);
					break;
				case "AlarmSettings":
					this.PerformRelatedEntityRemoval(this.AlarmSettings, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "AlarmSettings1":
					this.PerformRelatedEntityRemoval(this.AlarmSettings1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "Areas":
					this.PerformRelatedEntityRemoval(this.Areas, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "Areas1":
					this.PerformRelatedEntityRemoval(this.Areas1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "AreaShifts":
					this.PerformRelatedEntityRemoval(this.AreaShifts, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "AreaShifts1":
					this.PerformRelatedEntityRemoval(this.AreaShifts1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "Cells":
					this.PerformRelatedEntityRemoval(this.Cells, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "Cells1":
					this.PerformRelatedEntityRemoval(this.Cells1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "CellAlarmSettings":
					this.PerformRelatedEntityRemoval(this.CellAlarmSettings, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "CellAlarmSettings1":
					this.PerformRelatedEntityRemoval(this.CellAlarmSettings1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "DowntimeButtons":
					this.PerformRelatedEntityRemoval(this.DowntimeButtons, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "DowntimeButtons_":
					this.PerformRelatedEntityRemoval(this.DowntimeButtons_, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "LaunchApplications":
					this.PerformRelatedEntityRemoval(this.LaunchApplications, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "LaunchApplications1":
					this.PerformRelatedEntityRemoval(this.LaunchApplications1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "Plants":
					this.PerformRelatedEntityRemoval(this.Plants, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "Plants1":
					this.PerformRelatedEntityRemoval(this.Plants1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "Products":
					this.PerformRelatedEntityRemoval(this.Products, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "Products1":
					this.PerformRelatedEntityRemoval(this.Products1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "ProductionPlans":
					this.PerformRelatedEntityRemoval(this.ProductionPlans, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "ProductionPlans1":
					this.PerformRelatedEntityRemoval(this.ProductionPlans1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "ProductionPlanScheduledDowntimes":
					this.PerformRelatedEntityRemoval(this.ProductionPlanScheduledDowntimes, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "ProductionPlanScheduledDowntimes1":
					this.PerformRelatedEntityRemoval(this.ProductionPlanScheduledDowntimes1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "ReasonCodes":
					this.PerformRelatedEntityRemoval(this.ReasonCodes, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "ReasonCodes1":
					this.PerformRelatedEntityRemoval(this.ReasonCodes1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "RollupDefinitions":
					this.PerformRelatedEntityRemoval(this.RollupDefinitions, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "RollupDefinitions1":
					this.PerformRelatedEntityRemoval(this.RollupDefinitions1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "Schedules":
					this.PerformRelatedEntityRemoval(this.Schedules, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "Schedules1":
					this.PerformRelatedEntityRemoval(this.Schedules1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "UserLogins":
					this.PerformRelatedEntityRemoval(this.UserLogins, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "UserLogins1":
					this.PerformRelatedEntityRemoval(this.UserLogins1, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "UserLoginHistories":
					this.PerformRelatedEntityRemoval(this.UserLoginHistories, relatedEntity, signalRelatedEntityManyToOne);
					break;
				default:
					break;
			}
		}

		/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
		/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
		protected override List<IEntity2> GetDependingRelatedEntities()
		{
			List<IEntity2> toReturn = new List<IEntity2>();
			return toReturn;
		}
		
		/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
		/// entities will have to be persisted before this entity during a recursive save.</summary>
		/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
		protected override List<IEntity2> GetDependentRelatedEntities()
		{
			List<IEntity2> toReturn = new List<IEntity2>();
			if(_userLogin!=null)
			{
				toReturn.Add(_userLogin);
			}
			if(_userLogin1!=null)
			{
				toReturn.Add(_userLogin1);
			}
			return toReturn;
		}
		
		/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
		/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
		protected override List<IEntityCollection2> GetMemberEntityCollections()
		{
			List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
			toReturn.Add(this.AlarmSettings);
			toReturn.Add(this.AlarmSettings1);
			toReturn.Add(this.Areas);
			toReturn.Add(this.Areas1);
			toReturn.Add(this.AreaShifts);
			toReturn.Add(this.AreaShifts1);
			toReturn.Add(this.Cells);
			toReturn.Add(this.Cells1);
			toReturn.Add(this.CellAlarmSettings);
			toReturn.Add(this.CellAlarmSettings1);
			toReturn.Add(this.DowntimeButtons);
			toReturn.Add(this.DowntimeButtons_);
			toReturn.Add(this.LaunchApplications);
			toReturn.Add(this.LaunchApplications1);
			toReturn.Add(this.Plants);
			toReturn.Add(this.Plants1);
			toReturn.Add(this.Products);
			toReturn.Add(this.Products1);
			toReturn.Add(this.ProductionPlans);
			toReturn.Add(this.ProductionPlans1);
			toReturn.Add(this.ProductionPlanScheduledDowntimes);
			toReturn.Add(this.ProductionPlanScheduledDowntimes1);
			toReturn.Add(this.ReasonCodes);
			toReturn.Add(this.ReasonCodes1);
			toReturn.Add(this.RollupDefinitions);
			toReturn.Add(this.RollupDefinitions1);
			toReturn.Add(this.Schedules);
			toReturn.Add(this.Schedules1);
			toReturn.Add(this.UserLogins);
			toReturn.Add(this.UserLogins1);
			toReturn.Add(this.UserLoginHistories);
			return toReturn;
		}

		/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
		/// <param name="info"></param>
		/// <param name="context"></param>
		[EditorBrowsable(EditorBrowsableState.Never)]
		protected override void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			if (SerializationHelper.Optimization != SerializationOptimization.Fast) 
			{
				info.AddValue("_alarmSettings", ((_alarmSettings!=null) && (_alarmSettings.Count>0) && !this.MarkedForDeletion)?_alarmSettings:null);
				info.AddValue("_alarmSettings1", ((_alarmSettings1!=null) && (_alarmSettings1.Count>0) && !this.MarkedForDeletion)?_alarmSettings1:null);
				info.AddValue("_areas", ((_areas!=null) && (_areas.Count>0) && !this.MarkedForDeletion)?_areas:null);
				info.AddValue("_areas1", ((_areas1!=null) && (_areas1.Count>0) && !this.MarkedForDeletion)?_areas1:null);
				info.AddValue("_areaShifts", ((_areaShifts!=null) && (_areaShifts.Count>0) && !this.MarkedForDeletion)?_areaShifts:null);
				info.AddValue("_areaShifts1", ((_areaShifts1!=null) && (_areaShifts1.Count>0) && !this.MarkedForDeletion)?_areaShifts1:null);
				info.AddValue("_cells", ((_cells!=null) && (_cells.Count>0) && !this.MarkedForDeletion)?_cells:null);
				info.AddValue("_cells1", ((_cells1!=null) && (_cells1.Count>0) && !this.MarkedForDeletion)?_cells1:null);
				info.AddValue("_cellAlarmSettings", ((_cellAlarmSettings!=null) && (_cellAlarmSettings.Count>0) && !this.MarkedForDeletion)?_cellAlarmSettings:null);
				info.AddValue("_cellAlarmSettings1", ((_cellAlarmSettings1!=null) && (_cellAlarmSettings1.Count>0) && !this.MarkedForDeletion)?_cellAlarmSettings1:null);
				info.AddValue("_downtimeButtons", ((_downtimeButtons!=null) && (_downtimeButtons.Count>0) && !this.MarkedForDeletion)?_downtimeButtons:null);
				info.AddValue("_downtimeButtons_", ((_downtimeButtons_!=null) && (_downtimeButtons_.Count>0) && !this.MarkedForDeletion)?_downtimeButtons_:null);
				info.AddValue("_launchApplications", ((_launchApplications!=null) && (_launchApplications.Count>0) && !this.MarkedForDeletion)?_launchApplications:null);
				info.AddValue("_launchApplications1", ((_launchApplications1!=null) && (_launchApplications1.Count>0) && !this.MarkedForDeletion)?_launchApplications1:null);
				info.AddValue("_plants", ((_plants!=null) && (_plants.Count>0) && !this.MarkedForDeletion)?_plants:null);
				info.AddValue("_plants1", ((_plants1!=null) && (_plants1.Count>0) && !this.MarkedForDeletion)?_plants1:null);
				info.AddValue("_products", ((_products!=null) && (_products.Count>0) && !this.MarkedForDeletion)?_products:null);
				info.AddValue("_products1", ((_products1!=null) && (_products1.Count>0) && !this.MarkedForDeletion)?_products1:null);
				info.AddValue("_productionPlans", ((_productionPlans!=null) && (_productionPlans.Count>0) && !this.MarkedForDeletion)?_productionPlans:null);
				info.AddValue("_productionPlans1", ((_productionPlans1!=null) && (_productionPlans1.Count>0) && !this.MarkedForDeletion)?_productionPlans1:null);
				info.AddValue("_productionPlanScheduledDowntimes", ((_productionPlanScheduledDowntimes!=null) && (_productionPlanScheduledDowntimes.Count>0) && !this.MarkedForDeletion)?_productionPlanScheduledDowntimes:null);
				info.AddValue("_productionPlanScheduledDowntimes1", ((_productionPlanScheduledDowntimes1!=null) && (_productionPlanScheduledDowntimes1.Count>0) && !this.MarkedForDeletion)?_productionPlanScheduledDowntimes1:null);
				info.AddValue("_reasonCodes", ((_reasonCodes!=null) && (_reasonCodes.Count>0) && !this.MarkedForDeletion)?_reasonCodes:null);
				info.AddValue("_reasonCodes1", ((_reasonCodes1!=null) && (_reasonCodes1.Count>0) && !this.MarkedForDeletion)?_reasonCodes1:null);
				info.AddValue("_rollupDefinitions", ((_rollupDefinitions!=null) && (_rollupDefinitions.Count>0) && !this.MarkedForDeletion)?_rollupDefinitions:null);
				info.AddValue("_rollupDefinitions1", ((_rollupDefinitions1!=null) && (_rollupDefinitions1.Count>0) && !this.MarkedForDeletion)?_rollupDefinitions1:null);
				info.AddValue("_schedules", ((_schedules!=null) && (_schedules.Count>0) && !this.MarkedForDeletion)?_schedules:null);
				info.AddValue("_schedules1", ((_schedules1!=null) && (_schedules1.Count>0) && !this.MarkedForDeletion)?_schedules1:null);
				info.AddValue("_userLogins", ((_userLogins!=null) && (_userLogins.Count>0) && !this.MarkedForDeletion)?_userLogins:null);
				info.AddValue("_userLogins1", ((_userLogins1!=null) && (_userLogins1.Count>0) && !this.MarkedForDeletion)?_userLogins1:null);
				info.AddValue("_userLoginHistories", ((_userLoginHistories!=null) && (_userLoginHistories.Count>0) && !this.MarkedForDeletion)?_userLoginHistories:null);
				info.AddValue("_userLogin", (!this.MarkedForDeletion?_userLogin:null));
				info.AddValue("_userLogin1", (!this.MarkedForDeletion?_userLogin1:null));
			}
			// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
			// __LLBLGENPRO_USER_CODE_REGION_END
			base.GetObjectData(info, context);
		}


				
		/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
		/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
		protected override List<IEntityRelation> GetAllRelations()
		{
			return new UserLoginRelations().GetAllRelations();
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'AlarmSetting' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoAlarmSettings()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(AlarmSettingFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'AlarmSetting' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoAlarmSettings1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(AlarmSettingFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Area' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoAreas()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(AreaFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Area' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoAreas1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(AreaFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'AreaShift' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoAreaShifts()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(AreaShiftFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'AreaShift' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoAreaShifts1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(AreaShiftFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Cell' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoCells()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(CellFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Cell' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoCells1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(CellFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'CellAlarmSetting' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoCellAlarmSettings()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(CellAlarmSettingFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'CellAlarmSetting' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoCellAlarmSettings1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(CellAlarmSettingFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'DowntimeButton' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoDowntimeButtons()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(DowntimeButtonFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'DowntimeButton' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoDowntimeButtons_()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(DowntimeButtonFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'LaunchApplication' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoLaunchApplications()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(LaunchApplicationFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'LaunchApplication' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoLaunchApplications1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(LaunchApplicationFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Plant' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoPlants()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(PlantFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Plant' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoPlants1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(PlantFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Product' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoProducts()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ProductFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Product' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoProducts1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ProductFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'ProductionPlan' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoProductionPlans()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ProductionPlanFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'ProductionPlan' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoProductionPlans1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ProductionPlanFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'ProductionPlanScheduledDowntime' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoProductionPlanScheduledDowntimes()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ProductionPlanScheduledDowntimeFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'ProductionPlanScheduledDowntime' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoProductionPlanScheduledDowntimes1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ProductionPlanScheduledDowntimeFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'ReasonCode' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoReasonCodes()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ReasonCodeFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'ReasonCode' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoReasonCodes1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ReasonCodeFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'RollupDefinition' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoRollupDefinitions()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(RollupDefinitionFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'RollupDefinition' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoRollupDefinitions1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(RollupDefinitionFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Schedule' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoSchedules()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ScheduleFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Schedule' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoSchedules1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ScheduleFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'UserLogin' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoUserLogins()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(UserLoginFields.CreatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'UserLogin' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoUserLogins1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(UserLoginFields.LastUpdatedBy, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'UserLoginHistory' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoUserLoginHistories()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(UserLoginHistoryFields.UserLoginId, null, ComparisonOperator.Equal, this.UserLoginId));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'UserLogin' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoUserLogin()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(UserLoginFields.UserLoginId, null, ComparisonOperator.Equal, this.CreatedBy));
			return bucket;
		}

		/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'UserLogin' to this entity.</summary>
		/// <returns></returns>
		public virtual IRelationPredicateBucket GetRelationInfoUserLogin1()
		{
			IRelationPredicateBucket bucket = new RelationPredicateBucket();
			bucket.PredicateExpression.Add(new FieldCompareValuePredicate(UserLoginFields.UserLoginId, null, ComparisonOperator.Equal, this.LastUpdatedBy));
			return bucket;
		}
		

		/// <summary>Creates a new instance of the factory related to this entity</summary>
		protected override IEntityFactory2 CreateEntityFactory()
		{
			return EntityFactoryCache2.GetEntityFactory(typeof(UserLoginEntityFactory));
		}
#if !CF
		/// <summary>Adds the member collections to the collections queue (base first)</summary>
		/// <param name="collectionsQueue">The collections queue.</param>
		protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue) 
		{
			base.AddToMemberEntityCollectionsQueue(collectionsQueue);
			collectionsQueue.Enqueue(this._alarmSettings);
			collectionsQueue.Enqueue(this._alarmSettings1);
			collectionsQueue.Enqueue(this._areas);
			collectionsQueue.Enqueue(this._areas1);
			collectionsQueue.Enqueue(this._areaShifts);
			collectionsQueue.Enqueue(this._areaShifts1);
			collectionsQueue.Enqueue(this._cells);
			collectionsQueue.Enqueue(this._cells1);
			collectionsQueue.Enqueue(this._cellAlarmSettings);
			collectionsQueue.Enqueue(this._cellAlarmSettings1);
			collectionsQueue.Enqueue(this._downtimeButtons);
			collectionsQueue.Enqueue(this._downtimeButtons_);
			collectionsQueue.Enqueue(this._launchApplications);
			collectionsQueue.Enqueue(this._launchApplications1);
			collectionsQueue.Enqueue(this._plants);
			collectionsQueue.Enqueue(this._plants1);
			collectionsQueue.Enqueue(this._products);
			collectionsQueue.Enqueue(this._products1);
			collectionsQueue.Enqueue(this._productionPlans);
			collectionsQueue.Enqueue(this._productionPlans1);
			collectionsQueue.Enqueue(this._productionPlanScheduledDowntimes);
			collectionsQueue.Enqueue(this._productionPlanScheduledDowntimes1);
			collectionsQueue.Enqueue(this._reasonCodes);
			collectionsQueue.Enqueue(this._reasonCodes1);
			collectionsQueue.Enqueue(this._rollupDefinitions);
			collectionsQueue.Enqueue(this._rollupDefinitions1);
			collectionsQueue.Enqueue(this._schedules);
			collectionsQueue.Enqueue(this._schedules1);
			collectionsQueue.Enqueue(this._userLogins);
			collectionsQueue.Enqueue(this._userLogins1);
			collectionsQueue.Enqueue(this._userLoginHistories);
		}
		
		/// <summary>Gets the member collections queue from the queue (base first)</summary>
		/// <param name="collectionsQueue">The collections queue.</param>
		protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
		{
			base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
			this._alarmSettings = (EntityCollection<AlarmSettingEntity>) collectionsQueue.Dequeue();
			this._alarmSettings1 = (EntityCollection<AlarmSettingEntity>) collectionsQueue.Dequeue();
			this._areas = (EntityCollection<AreaEntity>) collectionsQueue.Dequeue();
			this._areas1 = (EntityCollection<AreaEntity>) collectionsQueue.Dequeue();
			this._areaShifts = (EntityCollection<AreaShiftEntity>) collectionsQueue.Dequeue();
			this._areaShifts1 = (EntityCollection<AreaShiftEntity>) collectionsQueue.Dequeue();
			this._cells = (EntityCollection<CellEntity>) collectionsQueue.Dequeue();
			this._cells1 = (EntityCollection<CellEntity>) collectionsQueue.Dequeue();
			this._cellAlarmSettings = (EntityCollection<CellAlarmSettingEntity>) collectionsQueue.Dequeue();
			this._cellAlarmSettings1 = (EntityCollection<CellAlarmSettingEntity>) collectionsQueue.Dequeue();
			this._downtimeButtons = (EntityCollection<DowntimeButtonEntity>) collectionsQueue.Dequeue();
			this._downtimeButtons_ = (EntityCollection<DowntimeButtonEntity>) collectionsQueue.Dequeue();
			this._launchApplications = (EntityCollection<LaunchApplicationEntity>) collectionsQueue.Dequeue();
			this._launchApplications1 = (EntityCollection<LaunchApplicationEntity>) collectionsQueue.Dequeue();
			this._plants = (EntityCollection<PlantEntity>) collectionsQueue.Dequeue();
			this._plants1 = (EntityCollection<PlantEntity>) collectionsQueue.Dequeue();
			this._products = (EntityCollection<ProductEntity>) collectionsQueue.Dequeue();
			this._products1 = (EntityCollection<ProductEntity>) collectionsQueue.Dequeue();
			this._productionPlans = (EntityCollection<ProductionPlanEntity>) collectionsQueue.Dequeue();
			this._productionPlans1 = (EntityCollection<ProductionPlanEntity>) collectionsQueue.Dequeue();
			this._productionPlanScheduledDowntimes = (EntityCollection<ProductionPlanScheduledDowntimeEntity>) collectionsQueue.Dequeue();
			this._productionPlanScheduledDowntimes1 = (EntityCollection<ProductionPlanScheduledDowntimeEntity>) collectionsQueue.Dequeue();
			this._reasonCodes = (EntityCollection<ReasonCodeEntity>) collectionsQueue.Dequeue();
			this._reasonCodes1 = (EntityCollection<ReasonCodeEntity>) collectionsQueue.Dequeue();
			this._rollupDefinitions = (EntityCollection<RollupDefinitionEntity>) collectionsQueue.Dequeue();
			this._rollupDefinitions1 = (EntityCollection<RollupDefinitionEntity>) collectionsQueue.Dequeue();
			this._schedules = (EntityCollection<ScheduleEntity>) collectionsQueue.Dequeue();
			this._schedules1 = (EntityCollection<ScheduleEntity>) collectionsQueue.Dequeue();
			this._userLogins = (EntityCollection<UserLoginEntity>) collectionsQueue.Dequeue();
			this._userLogins1 = (EntityCollection<UserLoginEntity>) collectionsQueue.Dequeue();
			this._userLoginHistories = (EntityCollection<UserLoginHistoryEntity>) collectionsQueue.Dequeue();

		}
		
		/// <summary>Determines whether the entity has populated member collections</summary>
		/// <returns>true if the entity has populated member collections.</returns>
		protected override bool HasPopulatedMemberEntityCollections()
		{
			bool toReturn = false;
			toReturn |=(this._alarmSettings != null);
			toReturn |=(this._alarmSettings1 != null);
			toReturn |=(this._areas != null);
			toReturn |=(this._areas1 != null);
			toReturn |=(this._areaShifts != null);
			toReturn |=(this._areaShifts1 != null);
			toReturn |=(this._cells != null);
			toReturn |=(this._cells1 != null);
			toReturn |=(this._cellAlarmSettings != null);
			toReturn |=(this._cellAlarmSettings1 != null);
			toReturn |=(this._downtimeButtons != null);
			toReturn |=(this._downtimeButtons_ != null);
			toReturn |=(this._launchApplications != null);
			toReturn |=(this._launchApplications1 != null);
			toReturn |=(this._plants != null);
			toReturn |=(this._plants1 != null);
			toReturn |=(this._products != null);
			toReturn |=(this._products1 != null);
			toReturn |=(this._productionPlans != null);
			toReturn |=(this._productionPlans1 != null);
			toReturn |=(this._productionPlanScheduledDowntimes != null);
			toReturn |=(this._productionPlanScheduledDowntimes1 != null);
			toReturn |=(this._reasonCodes != null);
			toReturn |=(this._reasonCodes1 != null);
			toReturn |=(this._rollupDefinitions != null);
			toReturn |=(this._rollupDefinitions1 != null);
			toReturn |=(this._schedules != null);
			toReturn |=(this._schedules1 != null);
			toReturn |=(this._userLogins != null);
			toReturn |=(this._userLogins1 != null);
			toReturn |=(this._userLoginHistories != null);
			return toReturn ? true : base.HasPopulatedMemberEntityCollections();
		}
		
		/// <summary>Creates the member entity collections queue.</summary>
		/// <param name="collectionsQueue">The collections queue.</param>
		/// <param name="requiredQueue">The required queue.</param>
		protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue) 
		{
			base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<AlarmSettingEntity>(EntityFactoryCache2.GetEntityFactory(typeof(AlarmSettingEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<AlarmSettingEntity>(EntityFactoryCache2.GetEntityFactory(typeof(AlarmSettingEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<AreaEntity>(EntityFactoryCache2.GetEntityFactory(typeof(AreaEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<AreaEntity>(EntityFactoryCache2.GetEntityFactory(typeof(AreaEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<AreaShiftEntity>(EntityFactoryCache2.GetEntityFactory(typeof(AreaShiftEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<AreaShiftEntity>(EntityFactoryCache2.GetEntityFactory(typeof(AreaShiftEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<CellEntity>(EntityFactoryCache2.GetEntityFactory(typeof(CellEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<CellEntity>(EntityFactoryCache2.GetEntityFactory(typeof(CellEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<CellAlarmSettingEntity>(EntityFactoryCache2.GetEntityFactory(typeof(CellAlarmSettingEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<CellAlarmSettingEntity>(EntityFactoryCache2.GetEntityFactory(typeof(CellAlarmSettingEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<DowntimeButtonEntity>(EntityFactoryCache2.GetEntityFactory(typeof(DowntimeButtonEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<DowntimeButtonEntity>(EntityFactoryCache2.GetEntityFactory(typeof(DowntimeButtonEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<LaunchApplicationEntity>(EntityFactoryCache2.GetEntityFactory(typeof(LaunchApplicationEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<LaunchApplicationEntity>(EntityFactoryCache2.GetEntityFactory(typeof(LaunchApplicationEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<PlantEntity>(EntityFactoryCache2.GetEntityFactory(typeof(PlantEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<PlantEntity>(EntityFactoryCache2.GetEntityFactory(typeof(PlantEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<ProductEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ProductEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<ProductEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ProductEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<ProductionPlanEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ProductionPlanEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<ProductionPlanEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ProductionPlanEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<ProductionPlanScheduledDowntimeEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ProductionPlanScheduledDowntimeEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<ProductionPlanScheduledDowntimeEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ProductionPlanScheduledDowntimeEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<ReasonCodeEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ReasonCodeEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<ReasonCodeEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ReasonCodeEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<RollupDefinitionEntity>(EntityFactoryCache2.GetEntityFactory(typeof(RollupDefinitionEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<RollupDefinitionEntity>(EntityFactoryCache2.GetEntityFactory(typeof(RollupDefinitionEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<ScheduleEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ScheduleEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<ScheduleEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ScheduleEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<UserLoginEntity>(EntityFactoryCache2.GetEntityFactory(typeof(UserLoginEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<UserLoginEntity>(EntityFactoryCache2.GetEntityFactory(typeof(UserLoginEntityFactory))) : null);
			collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<UserLoginHistoryEntity>(EntityFactoryCache2.GetEntityFactory(typeof(UserLoginHistoryEntityFactory))) : null);
		}
#endif
		/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
		/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
		protected override Dictionary<string, object> GetRelatedData()
		{
			Dictionary<string, object> toReturn = new Dictionary<string, object>();
			toReturn.Add("UserLogin", _userLogin);
			toReturn.Add("UserLogin1", _userLogin1);
			toReturn.Add("AlarmSettings", _alarmSettings);
			toReturn.Add("AlarmSettings1", _alarmSettings1);
			toReturn.Add("Areas", _areas);
			toReturn.Add("Areas1", _areas1);
			toReturn.Add("AreaShifts", _areaShifts);
			toReturn.Add("AreaShifts1", _areaShifts1);
			toReturn.Add("Cells", _cells);
			toReturn.Add("Cells1", _cells1);
			toReturn.Add("CellAlarmSettings", _cellAlarmSettings);
			toReturn.Add("CellAlarmSettings1", _cellAlarmSettings1);
			toReturn.Add("DowntimeButtons", _downtimeButtons);
			toReturn.Add("DowntimeButtons_", _downtimeButtons_);
			toReturn.Add("LaunchApplications", _launchApplications);
			toReturn.Add("LaunchApplications1", _launchApplications1);
			toReturn.Add("Plants", _plants);
			toReturn.Add("Plants1", _plants1);
			toReturn.Add("Products", _products);
			toReturn.Add("Products1", _products1);
			toReturn.Add("ProductionPlans", _productionPlans);
			toReturn.Add("ProductionPlans1", _productionPlans1);
			toReturn.Add("ProductionPlanScheduledDowntimes", _productionPlanScheduledDowntimes);
			toReturn.Add("ProductionPlanScheduledDowntimes1", _productionPlanScheduledDowntimes1);
			toReturn.Add("ReasonCodes", _reasonCodes);
			toReturn.Add("ReasonCodes1", _reasonCodes1);
			toReturn.Add("RollupDefinitions", _rollupDefinitions);
			toReturn.Add("RollupDefinitions1", _rollupDefinitions1);
			toReturn.Add("Schedules", _schedules);
			toReturn.Add("Schedules1", _schedules1);
			toReturn.Add("UserLogins", _userLogins);
			toReturn.Add("UserLogins1", _userLogins1);
			toReturn.Add("UserLoginHistories", _userLoginHistories);
			return toReturn;
		}

		/// <summary> Initializes the class members</summary>
		private void InitClassMembers()
		{
			PerformDependencyInjection();
			
			// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
			// __LLBLGENPRO_USER_CODE_REGION_END
			OnInitClassMembersComplete();
		}


		#region Custom Property Hashtable Setup
		/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
		private static void SetupCustomPropertyHashtables()
		{
			_customProperties = new Dictionary<string, string>();
			_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
			Dictionary<string, string> fieldHashtable;
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("CreatedBy", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("CreatedDate", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("Email", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("Enabled", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("FirstName", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("LastName", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("LastUpdatedBy", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("LastUpdatedDate", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("Login", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("Password", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("Permission", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("TimeStamp", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();
			_fieldsCustomProperties.Add("UserLoginId", fieldHashtable);
		}
		#endregion

		/// <summary> Removes the sync logic for member _userLogin</summary>
		/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
		/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
		private void DesetupSyncUserLogin(bool signalRelatedEntity, bool resetFKFields)
		{
			this.PerformDesetupSyncRelatedEntity( _userLogin, new PropertyChangedEventHandler( OnUserLoginPropertyChanged ), "UserLogin", VNet.VisiSuite.Dal.RelationClasses.StaticUserLoginRelations.UserLoginEntityUsingUserLoginIdCreatedByStatic, true, signalRelatedEntity, "UserLogins", resetFKFields, new int[] { (int)UserLoginFieldIndex.CreatedBy } );
			_userLogin = null;
		}

		/// <summary> setups the sync logic for member _userLogin</summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		private void SetupSyncUserLogin(IEntityCore relatedEntity)
		{
			if(_userLogin!=relatedEntity)
			{
				DesetupSyncUserLogin(true, true);
				_userLogin = (UserLoginEntity)relatedEntity;
				this.PerformSetupSyncRelatedEntity( _userLogin, new PropertyChangedEventHandler( OnUserLoginPropertyChanged ), "UserLogin", VNet.VisiSuite.Dal.RelationClasses.StaticUserLoginRelations.UserLoginEntityUsingUserLoginIdCreatedByStatic, true, new string[] {  } );
			}
		}
		
		/// <summary>Handles property change events of properties in a related entity.</summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void OnUserLoginPropertyChanged( object sender, PropertyChangedEventArgs e )
		{
			switch( e.PropertyName )
			{
				default:
					break;
			}
		}

		/// <summary> Removes the sync logic for member _userLogin1</summary>
		/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
		/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
		private void DesetupSyncUserLogin1(bool signalRelatedEntity, bool resetFKFields)
		{
			this.PerformDesetupSyncRelatedEntity( _userLogin1, new PropertyChangedEventHandler( OnUserLogin1PropertyChanged ), "UserLogin1", VNet.VisiSuite.Dal.RelationClasses.StaticUserLoginRelations.UserLoginEntityUsingUserLoginIdLastUpdatedByStatic, true, signalRelatedEntity, "UserLogins1", resetFKFields, new int[] { (int)UserLoginFieldIndex.LastUpdatedBy } );
			_userLogin1 = null;
		}

		/// <summary> setups the sync logic for member _userLogin1</summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		private void SetupSyncUserLogin1(IEntityCore relatedEntity)
		{
			if(_userLogin1!=relatedEntity)
			{
				DesetupSyncUserLogin1(true, true);
				_userLogin1 = (UserLoginEntity)relatedEntity;
				this.PerformSetupSyncRelatedEntity( _userLogin1, new PropertyChangedEventHandler( OnUserLogin1PropertyChanged ), "UserLogin1", VNet.VisiSuite.Dal.RelationClasses.StaticUserLoginRelations.UserLoginEntityUsingUserLoginIdLastUpdatedByStatic, true, new string[] {  } );
			}
		}
		
		/// <summary>Handles property change events of properties in a related entity.</summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void OnUserLogin1PropertyChanged( object sender, PropertyChangedEventArgs e )
		{
			switch( e.PropertyName )
			{
				default:
					break;
			}
		}

		/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
		/// <param name="validator">The validator object for this UserLoginEntity</param>
		/// <param name="fields">Fields of this entity</param>
		private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
		{
			OnInitializing();
			this.Fields = fields ?? CreateFields();
			this.Validator = validator;
			InitClassMembers();

			// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
			// __LLBLGENPRO_USER_CODE_REGION_END

			OnInitialized();

		}

		#region Class Property Declarations
		/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
		public  static UserLoginRelations Relations
		{
			get	{ return new UserLoginRelations(); }
		}
		
		/// <summary> The custom properties for this entity type.</summary>
		/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		public  static Dictionary<string, string> CustomProperties
		{
			get { return _customProperties;}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'AlarmSetting' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathAlarmSettings
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<AlarmSettingEntity>(EntityFactoryCache2.GetEntityFactory(typeof(AlarmSettingEntityFactory))), (IEntityRelation)GetRelationsForField("AlarmSettings")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.AlarmSettingEntity, 0, null, null, null, null, "AlarmSettings", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'AlarmSetting' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathAlarmSettings1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<AlarmSettingEntity>(EntityFactoryCache2.GetEntityFactory(typeof(AlarmSettingEntityFactory))), (IEntityRelation)GetRelationsForField("AlarmSettings1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.AlarmSettingEntity, 0, null, null, null, null, "AlarmSettings1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'Area' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathAreas
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<AreaEntity>(EntityFactoryCache2.GetEntityFactory(typeof(AreaEntityFactory))), (IEntityRelation)GetRelationsForField("Areas")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.AreaEntity, 0, null, null, null, null, "Areas", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'Area' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathAreas1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<AreaEntity>(EntityFactoryCache2.GetEntityFactory(typeof(AreaEntityFactory))), (IEntityRelation)GetRelationsForField("Areas1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.AreaEntity, 0, null, null, null, null, "Areas1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'AreaShift' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathAreaShifts
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<AreaShiftEntity>(EntityFactoryCache2.GetEntityFactory(typeof(AreaShiftEntityFactory))), (IEntityRelation)GetRelationsForField("AreaShifts")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.AreaShiftEntity, 0, null, null, null, null, "AreaShifts", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'AreaShift' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathAreaShifts1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<AreaShiftEntity>(EntityFactoryCache2.GetEntityFactory(typeof(AreaShiftEntityFactory))), (IEntityRelation)GetRelationsForField("AreaShifts1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.AreaShiftEntity, 0, null, null, null, null, "AreaShifts1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'Cell' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathCells
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<CellEntity>(EntityFactoryCache2.GetEntityFactory(typeof(CellEntityFactory))), (IEntityRelation)GetRelationsForField("Cells")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.CellEntity, 0, null, null, null, null, "Cells", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'Cell' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathCells1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<CellEntity>(EntityFactoryCache2.GetEntityFactory(typeof(CellEntityFactory))), (IEntityRelation)GetRelationsForField("Cells1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.CellEntity, 0, null, null, null, null, "Cells1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'CellAlarmSetting' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathCellAlarmSettings
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<CellAlarmSettingEntity>(EntityFactoryCache2.GetEntityFactory(typeof(CellAlarmSettingEntityFactory))), (IEntityRelation)GetRelationsForField("CellAlarmSettings")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.CellAlarmSettingEntity, 0, null, null, null, null, "CellAlarmSettings", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'CellAlarmSetting' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathCellAlarmSettings1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<CellAlarmSettingEntity>(EntityFactoryCache2.GetEntityFactory(typeof(CellAlarmSettingEntityFactory))), (IEntityRelation)GetRelationsForField("CellAlarmSettings1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.CellAlarmSettingEntity, 0, null, null, null, null, "CellAlarmSettings1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'DowntimeButton' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathDowntimeButtons
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<DowntimeButtonEntity>(EntityFactoryCache2.GetEntityFactory(typeof(DowntimeButtonEntityFactory))), (IEntityRelation)GetRelationsForField("DowntimeButtons")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.DowntimeButtonEntity, 0, null, null, null, null, "DowntimeButtons", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'DowntimeButton' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathDowntimeButtons_
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<DowntimeButtonEntity>(EntityFactoryCache2.GetEntityFactory(typeof(DowntimeButtonEntityFactory))), (IEntityRelation)GetRelationsForField("DowntimeButtons_")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.DowntimeButtonEntity, 0, null, null, null, null, "DowntimeButtons_", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'LaunchApplication' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathLaunchApplications
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<LaunchApplicationEntity>(EntityFactoryCache2.GetEntityFactory(typeof(LaunchApplicationEntityFactory))), (IEntityRelation)GetRelationsForField("LaunchApplications")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.LaunchApplicationEntity, 0, null, null, null, null, "LaunchApplications", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'LaunchApplication' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathLaunchApplications1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<LaunchApplicationEntity>(EntityFactoryCache2.GetEntityFactory(typeof(LaunchApplicationEntityFactory))), (IEntityRelation)GetRelationsForField("LaunchApplications1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.LaunchApplicationEntity, 0, null, null, null, null, "LaunchApplications1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'Plant' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathPlants
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<PlantEntity>(EntityFactoryCache2.GetEntityFactory(typeof(PlantEntityFactory))), (IEntityRelation)GetRelationsForField("Plants")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.PlantEntity, 0, null, null, null, null, "Plants", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'Plant' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathPlants1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<PlantEntity>(EntityFactoryCache2.GetEntityFactory(typeof(PlantEntityFactory))), (IEntityRelation)GetRelationsForField("Plants1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.PlantEntity, 0, null, null, null, null, "Plants1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'Product' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathProducts
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<ProductEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ProductEntityFactory))), (IEntityRelation)GetRelationsForField("Products")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.ProductEntity, 0, null, null, null, null, "Products", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'Product' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathProducts1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<ProductEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ProductEntityFactory))), (IEntityRelation)GetRelationsForField("Products1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.ProductEntity, 0, null, null, null, null, "Products1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'ProductionPlan' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathProductionPlans
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<ProductionPlanEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ProductionPlanEntityFactory))), (IEntityRelation)GetRelationsForField("ProductionPlans")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.ProductionPlanEntity, 0, null, null, null, null, "ProductionPlans", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'ProductionPlan' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathProductionPlans1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<ProductionPlanEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ProductionPlanEntityFactory))), (IEntityRelation)GetRelationsForField("ProductionPlans1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.ProductionPlanEntity, 0, null, null, null, null, "ProductionPlans1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'ProductionPlanScheduledDowntime' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathProductionPlanScheduledDowntimes
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<ProductionPlanScheduledDowntimeEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ProductionPlanScheduledDowntimeEntityFactory))), (IEntityRelation)GetRelationsForField("ProductionPlanScheduledDowntimes")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.ProductionPlanScheduledDowntimeEntity, 0, null, null, null, null, "ProductionPlanScheduledDowntimes", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'ProductionPlanScheduledDowntime' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathProductionPlanScheduledDowntimes1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<ProductionPlanScheduledDowntimeEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ProductionPlanScheduledDowntimeEntityFactory))), (IEntityRelation)GetRelationsForField("ProductionPlanScheduledDowntimes1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.ProductionPlanScheduledDowntimeEntity, 0, null, null, null, null, "ProductionPlanScheduledDowntimes1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'ReasonCode' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathReasonCodes
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<ReasonCodeEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ReasonCodeEntityFactory))), (IEntityRelation)GetRelationsForField("ReasonCodes")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.ReasonCodeEntity, 0, null, null, null, null, "ReasonCodes", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'ReasonCode' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathReasonCodes1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<ReasonCodeEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ReasonCodeEntityFactory))), (IEntityRelation)GetRelationsForField("ReasonCodes1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.ReasonCodeEntity, 0, null, null, null, null, "ReasonCodes1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'RollupDefinition' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathRollupDefinitions
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<RollupDefinitionEntity>(EntityFactoryCache2.GetEntityFactory(typeof(RollupDefinitionEntityFactory))), (IEntityRelation)GetRelationsForField("RollupDefinitions")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.RollupDefinitionEntity, 0, null, null, null, null, "RollupDefinitions", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'RollupDefinition' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathRollupDefinitions1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<RollupDefinitionEntity>(EntityFactoryCache2.GetEntityFactory(typeof(RollupDefinitionEntityFactory))), (IEntityRelation)GetRelationsForField("RollupDefinitions1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.RollupDefinitionEntity, 0, null, null, null, null, "RollupDefinitions1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'Schedule' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathSchedules
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<ScheduleEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ScheduleEntityFactory))), (IEntityRelation)GetRelationsForField("Schedules")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.ScheduleEntity, 0, null, null, null, null, "Schedules", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'Schedule' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathSchedules1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<ScheduleEntity>(EntityFactoryCache2.GetEntityFactory(typeof(ScheduleEntityFactory))), (IEntityRelation)GetRelationsForField("Schedules1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.ScheduleEntity, 0, null, null, null, null, "Schedules1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'UserLogin' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathUserLogins
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<UserLoginEntity>(EntityFactoryCache2.GetEntityFactory(typeof(UserLoginEntityFactory))), (IEntityRelation)GetRelationsForField("UserLogins")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, 0, null, null, null, null, "UserLogins", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'UserLogin' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathUserLogins1
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<UserLoginEntity>(EntityFactoryCache2.GetEntityFactory(typeof(UserLoginEntityFactory))), (IEntityRelation)GetRelationsForField("UserLogins1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, 0, null, null, null, null, "UserLogins1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'UserLoginHistory' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathUserLoginHistories
		{
			get	{ return new PrefetchPathElement2( new EntityCollection<UserLoginHistoryEntity>(EntityFactoryCache2.GetEntityFactory(typeof(UserLoginHistoryEntityFactory))), (IEntityRelation)GetRelationsForField("UserLoginHistories")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.UserLoginHistoryEntity, 0, null, null, null, null, "UserLoginHistories", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);	}
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'UserLogin' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathUserLogin
		{
			get	{ return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(UserLoginEntityFactory))),	(IEntityRelation)GetRelationsForField("UserLogin")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, 0, null, null, null, null, "UserLogin", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
		}

		/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'UserLogin' for this entity.</summary>
		/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
		public static IPrefetchPathElement2 PrefetchPathUserLogin1
		{
			get	{ return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(UserLoginEntityFactory))),	(IEntityRelation)GetRelationsForField("UserLogin1")[0], (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity, 0, null, null, null, null, "UserLogin1", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
		}


		/// <summary> The custom properties for the type of this entity instance.</summary>
		/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		[Browsable(false), XmlIgnore]
		protected override Dictionary<string, string> CustomPropertiesOfType
		{
			get { return CustomProperties;}
		}

		/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
		/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		public  static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
		{
			get { return _fieldsCustomProperties;}
		}

		/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
		/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		[Browsable(false), XmlIgnore]
		protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
		{
			get { return FieldsCustomProperties;}
		}

		/// <summary> The CreatedBy property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."CreatedBy"<br/>
		/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Int32 CreatedBy
		{
			get { return (System.Int32)GetValue((int)UserLoginFieldIndex.CreatedBy, true); }
			set	{ SetValue((int)UserLoginFieldIndex.CreatedBy, value); }
		}

		/// <summary> The CreatedDate property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."CreatedDate"<br/>
		/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.DateTime CreatedDate
		{
			get { return (System.DateTime)GetValue((int)UserLoginFieldIndex.CreatedDate, true); }
			set	{ SetValue((int)UserLoginFieldIndex.CreatedDate, value); }
		}

		/// <summary> The Email property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."Email"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 40<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual System.String Email
		{
			get { return (System.String)GetValue((int)UserLoginFieldIndex.Email, true); }
			set	{ SetValue((int)UserLoginFieldIndex.Email, value); }
		}

		/// <summary> The Enabled property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."Enabled"<br/>
		/// Table field type characteristics (type, precision, scale, length): Bit, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Boolean Enabled
		{
			get { return (System.Boolean)GetValue((int)UserLoginFieldIndex.Enabled, true); }
			set	{ SetValue((int)UserLoginFieldIndex.Enabled, value); }
		}

		/// <summary> The FirstName property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."FirstName"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 30<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.String FirstName
		{
			get { return (System.String)GetValue((int)UserLoginFieldIndex.FirstName, true); }
			set	{ SetValue((int)UserLoginFieldIndex.FirstName, value); }
		}

		/// <summary> The LastName property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."LastName"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 30<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.String LastName
		{
			get { return (System.String)GetValue((int)UserLoginFieldIndex.LastName, true); }
			set	{ SetValue((int)UserLoginFieldIndex.LastName, value); }
		}

		/// <summary> The LastUpdatedBy property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."LastUpdatedBy"<br/>
		/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Int32 LastUpdatedBy
		{
			get { return (System.Int32)GetValue((int)UserLoginFieldIndex.LastUpdatedBy, true); }
			set	{ SetValue((int)UserLoginFieldIndex.LastUpdatedBy, value); }
		}

		/// <summary> The LastUpdatedDate property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."LastUpdatedDate"<br/>
		/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.DateTime LastUpdatedDate
		{
			get { return (System.DateTime)GetValue((int)UserLoginFieldIndex.LastUpdatedDate, true); }
			set	{ SetValue((int)UserLoginFieldIndex.LastUpdatedDate, value); }
		}

		/// <summary> The Login property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."Login"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 32<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.String Login
		{
			get { return (System.String)GetValue((int)UserLoginFieldIndex.Login, true); }
			set	{ SetValue((int)UserLoginFieldIndex.Login, value); }
		}

		/// <summary> The Password property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."Password"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 256<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.String Password
		{
			get { return (System.String)GetValue((int)UserLoginFieldIndex.Password, true); }
			set	{ SetValue((int)UserLoginFieldIndex.Password, value); }
		}

		/// <summary> The Permission property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."Permission"<br/>
		/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Int32 Permission
		{
			get { return (System.Int32)GetValue((int)UserLoginFieldIndex.Permission, true); }
			set	{ SetValue((int)UserLoginFieldIndex.Permission, value); }
		}

		/// <summary> The TimeStamp property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."TimeStamp"<br/>
		/// Table field type characteristics (type, precision, scale, length): Timestamp, 0, 0, 2147483647<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Byte[] TimeStamp
		{
			get { return (System.Byte[])GetValue((int)UserLoginFieldIndex.TimeStamp, true); }

		}

		/// <summary> The UserLoginId property of the Entity UserLogin<br/><br/></summary>
		/// <remarks>Mapped on  table field: "UserLogin"."UserLoginID"<br/>
		/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, true</remarks>
		public virtual System.Int32 UserLoginId
		{
			get { return (System.Int32)GetValue((int)UserLoginFieldIndex.UserLoginId, true); }
			set	{ SetValue((int)UserLoginFieldIndex.UserLoginId, value); }
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'AlarmSettingEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(AlarmSettingEntity))]
		public virtual EntityCollection<AlarmSettingEntity> AlarmSettings
		{
			get { return GetOrCreateEntityCollection<AlarmSettingEntity, AlarmSettingEntityFactory>("UserLogin", true, false, ref _alarmSettings);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'AlarmSettingEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(AlarmSettingEntity))]
		public virtual EntityCollection<AlarmSettingEntity> AlarmSettings1
		{
			get { return GetOrCreateEntityCollection<AlarmSettingEntity, AlarmSettingEntityFactory>("UserLogin1", true, false, ref _alarmSettings1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'AreaEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(AreaEntity))]
		public virtual EntityCollection<AreaEntity> Areas
		{
			get { return GetOrCreateEntityCollection<AreaEntity, AreaEntityFactory>("UserLogin", true, false, ref _areas);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'AreaEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(AreaEntity))]
		public virtual EntityCollection<AreaEntity> Areas1
		{
			get { return GetOrCreateEntityCollection<AreaEntity, AreaEntityFactory>("UserLogin1", true, false, ref _areas1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'AreaShiftEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(AreaShiftEntity))]
		public virtual EntityCollection<AreaShiftEntity> AreaShifts
		{
			get { return GetOrCreateEntityCollection<AreaShiftEntity, AreaShiftEntityFactory>("UserLogin", true, false, ref _areaShifts);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'AreaShiftEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(AreaShiftEntity))]
		public virtual EntityCollection<AreaShiftEntity> AreaShifts1
		{
			get { return GetOrCreateEntityCollection<AreaShiftEntity, AreaShiftEntityFactory>("UserLogin1", true, false, ref _areaShifts1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'CellEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(CellEntity))]
		public virtual EntityCollection<CellEntity> Cells
		{
			get { return GetOrCreateEntityCollection<CellEntity, CellEntityFactory>("UserLogin", true, false, ref _cells);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'CellEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(CellEntity))]
		public virtual EntityCollection<CellEntity> Cells1
		{
			get { return GetOrCreateEntityCollection<CellEntity, CellEntityFactory>("UserLogin1", true, false, ref _cells1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'CellAlarmSettingEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(CellAlarmSettingEntity))]
		public virtual EntityCollection<CellAlarmSettingEntity> CellAlarmSettings
		{
			get { return GetOrCreateEntityCollection<CellAlarmSettingEntity, CellAlarmSettingEntityFactory>("UserLogin", true, false, ref _cellAlarmSettings);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'CellAlarmSettingEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(CellAlarmSettingEntity))]
		public virtual EntityCollection<CellAlarmSettingEntity> CellAlarmSettings1
		{
			get { return GetOrCreateEntityCollection<CellAlarmSettingEntity, CellAlarmSettingEntityFactory>("UserLogin1", true, false, ref _cellAlarmSettings1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'DowntimeButtonEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(DowntimeButtonEntity))]
		public virtual EntityCollection<DowntimeButtonEntity> DowntimeButtons
		{
			get { return GetOrCreateEntityCollection<DowntimeButtonEntity, DowntimeButtonEntityFactory>("UserLogin", true, false, ref _downtimeButtons);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'DowntimeButtonEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(DowntimeButtonEntity))]
		public virtual EntityCollection<DowntimeButtonEntity> DowntimeButtons_
		{
			get { return GetOrCreateEntityCollection<DowntimeButtonEntity, DowntimeButtonEntityFactory>("UserLogin_", true, false, ref _downtimeButtons_);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'LaunchApplicationEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(LaunchApplicationEntity))]
		public virtual EntityCollection<LaunchApplicationEntity> LaunchApplications
		{
			get { return GetOrCreateEntityCollection<LaunchApplicationEntity, LaunchApplicationEntityFactory>("UserLogin", true, false, ref _launchApplications);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'LaunchApplicationEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(LaunchApplicationEntity))]
		public virtual EntityCollection<LaunchApplicationEntity> LaunchApplications1
		{
			get { return GetOrCreateEntityCollection<LaunchApplicationEntity, LaunchApplicationEntityFactory>("UserLogin1", true, false, ref _launchApplications1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'PlantEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(PlantEntity))]
		public virtual EntityCollection<PlantEntity> Plants
		{
			get { return GetOrCreateEntityCollection<PlantEntity, PlantEntityFactory>("UserLogin", true, false, ref _plants);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'PlantEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(PlantEntity))]
		public virtual EntityCollection<PlantEntity> Plants1
		{
			get { return GetOrCreateEntityCollection<PlantEntity, PlantEntityFactory>("UserLogin1", true, false, ref _plants1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'ProductEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(ProductEntity))]
		public virtual EntityCollection<ProductEntity> Products
		{
			get { return GetOrCreateEntityCollection<ProductEntity, ProductEntityFactory>("UserLogin", true, false, ref _products);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'ProductEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(ProductEntity))]
		public virtual EntityCollection<ProductEntity> Products1
		{
			get { return GetOrCreateEntityCollection<ProductEntity, ProductEntityFactory>("UserLogin1", true, false, ref _products1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'ProductionPlanEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(ProductionPlanEntity))]
		public virtual EntityCollection<ProductionPlanEntity> ProductionPlans
		{
			get { return GetOrCreateEntityCollection<ProductionPlanEntity, ProductionPlanEntityFactory>("UserLogin", true, false, ref _productionPlans);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'ProductionPlanEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(ProductionPlanEntity))]
		public virtual EntityCollection<ProductionPlanEntity> ProductionPlans1
		{
			get { return GetOrCreateEntityCollection<ProductionPlanEntity, ProductionPlanEntityFactory>("UserLogin1", true, false, ref _productionPlans1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'ProductionPlanScheduledDowntimeEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(ProductionPlanScheduledDowntimeEntity))]
		public virtual EntityCollection<ProductionPlanScheduledDowntimeEntity> ProductionPlanScheduledDowntimes
		{
			get { return GetOrCreateEntityCollection<ProductionPlanScheduledDowntimeEntity, ProductionPlanScheduledDowntimeEntityFactory>("UserLogin", true, false, ref _productionPlanScheduledDowntimes);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'ProductionPlanScheduledDowntimeEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(ProductionPlanScheduledDowntimeEntity))]
		public virtual EntityCollection<ProductionPlanScheduledDowntimeEntity> ProductionPlanScheduledDowntimes1
		{
			get { return GetOrCreateEntityCollection<ProductionPlanScheduledDowntimeEntity, ProductionPlanScheduledDowntimeEntityFactory>("UserLogin1", true, false, ref _productionPlanScheduledDowntimes1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'ReasonCodeEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(ReasonCodeEntity))]
		public virtual EntityCollection<ReasonCodeEntity> ReasonCodes
		{
			get { return GetOrCreateEntityCollection<ReasonCodeEntity, ReasonCodeEntityFactory>("UserLogin", true, false, ref _reasonCodes);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'ReasonCodeEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(ReasonCodeEntity))]
		public virtual EntityCollection<ReasonCodeEntity> ReasonCodes1
		{
			get { return GetOrCreateEntityCollection<ReasonCodeEntity, ReasonCodeEntityFactory>("UserLogin1", true, false, ref _reasonCodes1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'RollupDefinitionEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(RollupDefinitionEntity))]
		public virtual EntityCollection<RollupDefinitionEntity> RollupDefinitions
		{
			get { return GetOrCreateEntityCollection<RollupDefinitionEntity, RollupDefinitionEntityFactory>("UserLogin", true, false, ref _rollupDefinitions);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'RollupDefinitionEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(RollupDefinitionEntity))]
		public virtual EntityCollection<RollupDefinitionEntity> RollupDefinitions1
		{
			get { return GetOrCreateEntityCollection<RollupDefinitionEntity, RollupDefinitionEntityFactory>("UserLogin1", true, false, ref _rollupDefinitions1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'ScheduleEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(ScheduleEntity))]
		public virtual EntityCollection<ScheduleEntity> Schedules
		{
			get { return GetOrCreateEntityCollection<ScheduleEntity, ScheduleEntityFactory>("UserLogin", true, false, ref _schedules);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'ScheduleEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(ScheduleEntity))]
		public virtual EntityCollection<ScheduleEntity> Schedules1
		{
			get { return GetOrCreateEntityCollection<ScheduleEntity, ScheduleEntityFactory>("UserLogin1", true, false, ref _schedules1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'UserLoginEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(UserLoginEntity))]
		public virtual EntityCollection<UserLoginEntity> UserLogins
		{
			get { return GetOrCreateEntityCollection<UserLoginEntity, UserLoginEntityFactory>("UserLogin", true, false, ref _userLogins);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'UserLoginEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(UserLoginEntity))]
		public virtual EntityCollection<UserLoginEntity> UserLogins1
		{
			get { return GetOrCreateEntityCollection<UserLoginEntity, UserLoginEntityFactory>("UserLogin1", true, false, ref _userLogins1);	}
		}

		/// <summary> Gets the EntityCollection with the related entities of type 'UserLoginHistoryEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
		[TypeContainedAttribute(typeof(UserLoginHistoryEntity))]
		public virtual EntityCollection<UserLoginHistoryEntity> UserLoginHistories
		{
			get { return GetOrCreateEntityCollection<UserLoginHistoryEntity, UserLoginHistoryEntityFactory>("UserLogin", true, false, ref _userLoginHistories);	}
		}

		/// <summary> Gets / sets related entity of type 'UserLoginEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
		[Browsable(false)]
		public virtual UserLoginEntity UserLogin
		{
			get	{ return _userLogin; }
			set
			{
				if(this.IsDeserializing)
				{
					SetupSyncUserLogin(value);
				}
				else
				{
					SetSingleRelatedEntityNavigator(value, "UserLogins", "UserLogin", _userLogin, true); 
				}
			}
		}

		/// <summary> Gets / sets related entity of type 'UserLoginEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
		[Browsable(false)]
		public virtual UserLoginEntity UserLogin1
		{
			get	{ return _userLogin1; }
			set
			{
				if(this.IsDeserializing)
				{
					SetupSyncUserLogin1(value);
				}
				else
				{
					SetSingleRelatedEntityNavigator(value, "UserLogins1", "UserLogin1", _userLogin1, true); 
				}
			}
		}
	
		/// <summary> Gets the type of the hierarchy this entity is in. </summary>
		protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
		{
			get { return InheritanceHierarchyType.None;}
		}
		
		/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
		protected override bool LLBLGenProIsSubType
		{
			get { return false;}
		}
		
		/// <summary>Returns the VNet.VisiSuite.Dal.EntityType enum value for this entity.</summary>
		[Browsable(false), XmlIgnore]
		protected override int LLBLGenProEntityTypeValue 
		{ 
			get { return (int)VNet.VisiSuite.Dal.EntityType.UserLoginEntity; }
		}

		#endregion


		#region Custom Entity code
		
		// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
		// __LLBLGENPRO_USER_CODE_REGION_END
		#endregion

		#region Included code

		#endregion
	}
}
